package luogu;

import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main1152 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = sc.nextInt();
        }
        if (n == 1) {
            System.out.println("Jolly");
            return;
        }

        //存储相邻元素差的绝对值
        Set<Integer> diff = new HashSet<>();
        //当i=n-1时  就是arr[n-1]-arr[n]  n的后面没有东西了  所以i只能取到 n-1
        for (int i = 0; i < n - 1; i++) {
            int abs = Math.abs(arr[i] - arr[i + 1]);
            if (abs >= 1 && abs <= n - 1) {
                diff.add(abs);
            }
        }
        if (diff.size() == n - 1) {
            System.out.println("Jolly");
        } else {
            System.out.println("Not jolly");
        }
    }
}
